package org.libspark.fmvc.util.reflection.impl
{
	import flash.utils.describeType;
	
	import org.libspark.fmvc.util.reflection.IReflector;
	import org.libspark.fmvc.util.reflection.IType;


	internal class Type implements IType
	{

		private var _reflector:IReflector;
		
		private var _clazz:Class;
		
		private var _parent:String;

		public function Type(clazz:Class, reflector:IReflector)
		{
			var xml:XML = describeType(clazz);

			_reflector = reflector;
			_clazz = clazz;
			_parent = xml.factory.extendsClass.@type;
		}

		public function get reflector():IReflector
		{
			return _reflector;
		}
		
		public function get clazz():Class{
			return _clazz;
		}
		
		public function get parent():IType{
			return _reflector.getType(_parent);
		}
	}
}